<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="<?php echo site_url("style.css"); ?>" type="text/css" />
<title>Admin Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
	<!-- header starts here -->
<div id="header">
  <div id="header-content"> 
    <ul>
      <li><a href="<?php echo site_url("admin/logout/"); ?>">Logout</a></li>
    </ul>
  </div>
</div>

<div id="content-wrap">
	
	<div id="nav">
		<img src="<?php echo site_url("images/Nav_Head.png"); ?>" alt="navigation header" class="no-border" />
		<a href="<?php echo site_url("review"); ?>"><img src="<?php echo site_url("images/Home_On.png"); ?>" alt="home" class="no-border" /></a>
		<a href="<?php echo site_url("review/reviews/default/0/A"); ?>"><img src="<?php echo site_url("images/Reviews_Off.png"); ?>" alt="reviews" class="no-border" /></a>
		<br />
		<div class="navlink"><a href="<?php echo site_url("admin/post/"); ?>">Add Post</a></div><br />
		<div class="navlink"><a href="<?php echo site_url("admin/add_series/"); ?>">Add Series</a></div><br />
		<div class="navlink"><a href="<?php echo site_url("admin/edit/post/0"); ?>">Edit Post/Review</a></div><br />
		<div class="navlink"><a href="<?php echo site_url("admin/edit/series/0"); ?>">Edit Series</a></div><br />
        <div class="navlink"><a href="<?php echo site_url("admin/manage_list/0"); ?>">Media Management</a></div><br />
		<div class="navlink"><a href="<?php echo site_url("admin/edit_schedule/"); ?>">Edit Schedule</a></div><br />
	</div>
		
	<div id="adminwrapper">
    	<table width="100%">
		
<?php
	foreach($list as $row){
		
		if(is_null($row->series)){
			echo "<tr><td><a href=\"review/article/$row->p_id\">[$row->poster - $row->class] $row->title @ $row->posted</a></td></tr>";
		} else {
			switch($row->episode){
				case 0:
					$snip = 'Preview';
					break;
				case 99:
					$snip = 'Complete Review';
					break;
				default:
					$snip = "Episode $row->episode";
					break;
			}
			echo "<tr><td><a href=\"review/article/$row->p_id\">[$row->poster - $row->class] $row->name - $snip @ $row->posted</a></td></tr>";
		}
	}
?>
		
		</table>
	</div>
</div>

</body>
</html>
